package com.consumer0.demo;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.MessageProperties;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.concurrent.TimeoutException;

/**
 * 简单模式
 * @author xxx
 */
public class SimpleType {
    public static void main(String[] args) throws IOException, TimeoutException {
//        String message = "helloword1";
        //相当于数据库jdbc连接
        Connection connection = ConnectionConfig.getConnection();
        //相当于JDBc中的statement
        Channel channel = connection.createChannel();
        String queueName = "simple.type.queue";
       // channel.basicConsume(queueName,true,)
        channel.queueDeclare(queueName, false, false, false, null);
        System.out.println("接收！");
        channel.close();
        connection.close();


    }
}
